package com.wing.order.dao;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wing.order.model.entity.InventoryInoutJob;
import com.wing.order.model.response.InventoryInoutJobVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 出/入库作业单记录-Dao
 *
 * @author
 */
@Mapper
public interface InventoryInoutJobDao extends BaseMapper<InventoryInoutJob> {

    /**
     * 列表-app
     *
     * @param params
     *
     * @return
     */
    List<InventoryInoutJobVO> list4app(@Param("params") Map<String, Object> params);

    /**
     * 分页列表-app
     *
     * @param page
     * @param params
     *
     * @return
     */
    List<InventoryInoutJobVO> list4app(@Param("page") Page<InventoryInoutJobVO> page, @Param("params") Map<String, Object> params);

    List<InventoryInoutJobVO> list4loading(@Param("page") Page<InventoryInoutJobVO> page, @Param("params") Map<String, Object> params);

    /**
     * 详情-app
     *
     * @param id
     *
     * @return
     */
    InventoryInoutJobVO get4appById(Long id);

    /**
     * 入库单列表
     * @param page
     * @param queryWrapper
     * @return
     */
    public Page<InventoryInoutJobVO> getInventoryInoutJobPageList (IPage<InventoryInoutJobVO> page, @Param("ew") QueryWrapper<InventoryInoutJobVO> queryWrapper);
    /**
     * 查询入库计划的送料数和入库作业入库的包装条码数
     * @param planId
     * @return
     */
    Map<Integer, Object> getInventoryInoutSum(@Param("planId") Long planId);

    /**
     * 查询采购入库计划的采购总数和入库作业的包装条码数
     * @param planId
     * @return
     */
    Map<Integer, Object> getPurchaseSum(@Param("planId") Long planId);
}
